repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
836 - Largest submatrix (DP, programación dinámica, O(n^4) ¿Existirá un O(n^3)?)
[andmenj-acm.git]
/
10127 - Ones
/
robadoDelForo.dpr
blob
bffb8c0618c2b08f927c6f94177fd01cce1940ac
1
program robadoDelForo;
\r
2
\r
3
{$APPTYPE CONSOLE}
\r
4
\r
5
uses
\r
6
SysUtils;
\r
7
\r
8
var
\r
9
a, l, k, no : integer;
\r
10
begin
\r
11
reset(input, 'input.txt');
\r
12
reset(output, 'output.txt');
\r
13
while not EOF do
\r
14
begin
\r
15
readLn(a);
\r
16
k := 1;
\r
17
no := 1;
\r
18
while true do
\r
19
begin
\r
20
l := k mod a;
\r
21
if (l = 0) then
\r
22
begin
\r
23
writeLn(no);
\r
24
break;
\r
25
end;
\r
26
k := l * 10 + 1;
\r
27
no := no + 1;
\r
28
end;
\r
29
end;
\r
30
end.
\r